package org.example.Server.controller.semester;


import lombok.extern.slf4j.Slf4j;
import org.example.Server.service.semester.SemesterService;
import org.example.Server.utils.ResultAPI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/youxich/semester/data")
public class SemesterDataController {
    @Autowired
    private SemesterService semesterService;

    /**
     * 获取课堂数据
     *
     * @param sem_id
     * @return
     */
    @GetMapping("score")
    public ResultAPI getSemesterData(@RequestParam Integer sem_id) {
        return semesterService.getSemesterData(sem_id);
    }

    /**
     * 获取课堂活跃度
     *
     * @param sem_id
     * @return
     */
    @GetMapping("activeness")
    public ResultAPI getActiveness(@RequestParam Integer sem_id) {
        return semesterService.getActiveness(sem_id);
    }

    /**
     * 获取课堂得分率
     *
     * @param sem_id
     * @return
     */
    @GetMapping("hmkScoreRate")
    public ResultAPI getHmkScoreRate(@RequestParam Integer sem_id) {
        return semesterService.getHmkScoreRate(sem_id);
    }

    /**
     * 获取课堂评分等级
     *
     * @param sem_id
     */
    @GetMapping("hmkLevel")
    public ResultAPI getHmkLevel(@RequestParam Integer sem_id) {
        return semesterService.getHmkLevel(sem_id);
    }
}

